<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>10-event事件对象</title>
    <style>
        #parent{
            width: 200px;
            height: 200px;
            border: 1px red solid;
            background-color: red;
        }
        #child{
            width: 100px;
            height: 100px;
            border: 1px red solid;
            background-color: pink;
        }
    </style>
    <script>
        window.onload = function () {
            let parentEle = document.getElementById("parent");
            let childEle = document.getElementById("child");

            parentEle.onclick = function () {
                alert("鼠标单击了大盒子")
            }
            childEle.onclick = function () {
                alert("鼠标单击了小盒子")
                // 阻止事件向上冒泡
                event.stopPropagation();
            }

            // 阻止事件原事件
            var aEle = document.getElementsByTagName("a");
            aEle.onclick=

        }
    </script>
</head>
<body>
<div id="parent">
    我是parent
    <div id="child">我是child</div>
</div>
<a href="http://www.baidu.com" id="a">点我去百度</a>

</body>
</html>